/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.business;

/**
 *
 * @author dpatchett
 */
public class FilteredQuery {

    private StringBuilder query;
    private boolean whereClauseAdded = false;

    public FilteredQuery(String baseQuery) {
        query = new StringBuilder(baseQuery);
    }

    public void addClause(String clause) {
        if (!whereClauseAdded) {
            query.append(" WHERE ");
            whereClauseAdded = true;
        } else {
            query.append(" AND ");
        }
        query.append(clause);
    }

    public String getQuery() {
        return query.toString();
    }
}
